package com.it.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
/*
 * Spring 的初始化类
 * */
public class SpirngInit extends AbstractAnnotationConfigDispatcherServletInitializer {
    // root容器
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{
                // 连接池配置类
                DataSourceConfig.class,
                // 持久层配置类
                MapperConfig.class,
                // 业务层配置类
                ServiceConfig.class,
        };
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{
                // 控制层配置类
                CotrollerConfig.class
        };
    }

    @Override
    protected String[] getServletMappings() {
        // 拦截路径
        return new String[]{"/"};
    }
}
